<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{

   protected $fillable = ['company','type','orderType','orderNo','date','buyerState','sellState','clientState','clientId', 'clientName','sellId','sellName','ordererId','ordererName','buyerId','buyerName','buyerPaymentState','deliverDate', 'startDate','endDate', 'state', 'refund', 'result','expressType','express','expressNo','expressState','expressCost','express2','expressNo2','expressState2','expressCost2','imprest','cost','costUnit','costState','costType','costNo','costDate','receipt','receiptUnit','receiptState','receiptType','receiptNo','receiptDate','notes','other1'];



    public function goods()
    {
        return $this->hasMany('App\OrderGoods', 'orderId');
    }
    public function client()
    {
        return $this->belongsToMany($this, 'ooos', 'pid', 'cid');
    }


//    public function ordertask()
//    {
//        return $this->belongsTo('App\Ordertask');
//    }
}
